<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.ld.com/shield/tags" prefix="shield"%>
<%@ taglib uri="http://www.ld.com/system/tags" prefix="system"%>
<style>
.text-danger{
	color: red
}
</style>
<%-- 权限判断 --%>
<shield:permssion type="button">
<div class="contentBody">
	<table class="tab-list shield-table-odd">
		<col width="20%">
		<col width="20%">
		<caption>&nbsp;&nbsp;CPU信息</caption>
		<thead>
         <tr>
           <th>属性</th>
            <th>值</th>
           </tr>
        </thead>
        <tr>
			<td title="CPU"><label>CPU：</label></td>
			<td>${server.cpu.cpuName}</td>
		</tr>
		<tr>
			<td title="核心数"><label>核心数：</label></td>
			<td>${server.cpu.cpuNum}个</td>
		</tr>
		<tr>
			<td title="用户使用率"><label>用户使用率：</label></td>
			<td>${server.cpu.used }%</td>
		</tr>
		<tr>
			<td title="系统使用率"><label>系统使用率：</label></td>
			<td>${server.cpu.sys}%</td>
		</tr>
		<tr>
			<td><label>当前空闲率：</label></td>
			<td>${server.cpu.free}%</td>
		</tr>
			<tr>
			<td><label>进程：</label></td>
			<td>${server.cpu.processCount}个</td>
		</tr>
			<tr>
			<td><label>线程：</label></td>
			<td>${server.cpu.threadCount}个</td>
		</tr>
	</table>
	<table class="tab-list shield-table-odd">
		<col width="20%">
		<col width="20%">
		<caption>&nbsp;&nbsp;内存信息</caption>
		<thead>
             <tr>
                 <th>属性</th>
                 <th>内存</th>
                 <th>JVM</th>
             </tr>
           </thead>
		 <tr>
         <td>总内存</td>
         <td >${server.mem.total}GB</td>
         <td >${server.jvm.total}MB</td>
     </tr>
	 <tr>
       <td>已用内存</td>
       <td >${server.mem.used}GB</td>
       <td >${server.jvm.used }MB</td>
   </tr>
   <tr>
       <td>剩余内存</td>
       <td >${server.mem.free}GB</td>
       <td >${server.jvm.free }MB</td>
   </tr>
   <tr>
       <td>使用率</td>
       <td class="${server.mem.usage gt 80 ? 'text-danger': ''}">${server.mem.usage}%</td>
       <td class="${server.jvm.usage gt 80 ? 'text-danger': ''}">${server.jvm.usage}%</td>
   </tr>
	</table>
	<table class="tab-list shield-table-odd">
		<col width="20%">
		<col width="20%">
		<col width="20%">
		<caption>&nbsp;&nbsp;服务器信息</caption>
	    <tr>
           <td>服务器名称</td>
           <td >${server.sys.computerName}</td>
           <td>操作系统</td>
           <td >${server.sys.osName}</td>
       </tr>
       <tr>
           <td>服务器IP</td>
           <td >${server.sys.computerIp}</td>
           <td>系统架构</td>
           <td >${server.sys.osArch}</td>
       </tr>
	</table>
	
		<table class="tab-list shield-table-odd">
		<col width="20%">
		<col width="20%">
		<col width="20%">
		<caption>&nbsp;&nbsp;Java虚拟机信息</caption>
	 <tr>
      <td>Java名称</td>
      <td >${server.jvm.name}</td>
      <td>Java版本</td>
      <td >${server.jvm.version}</td>
  </tr>
  <tr>
      <td>启动时间</td>
      <td >${server.jvm.startTime}</td>
      <td>运行时长</td>
      <td >${server.jvm.runTime}</td>
  </tr>
     <tr>
      <td colspan="1">线程数</td>
      <td colspan="3" >${server.jvm.threadCount}</td>
  </tr>
  <tr>
      <td colspan="1">安装路径</td>
      <td colspan="3" >${server.jvm.home}</td>
  </tr>
   <tr>
      <td colspan="1">项目路径</td>
      <td colspan="3" >${server.sys.userDir}</td>
  </tr>
	</table>
	<table class="tab-list shield-table-odd">
		<col width="20%">
		<caption>&nbsp;&nbsp;磁盘状态</caption>
	 <thead>
       <tr>
           <th>盘符路径</th>
           <th>文件系统</th>
           <th>盘符类型</th>
           <th>总大小</th>
           <th>可用大小</th>
           <th>已用大小</th>
           <th>已用百分比</th>
       </tr>
   </thead>	
   <c:forEach var="sysFile" items="${server.sysFiles}">
	  <tr >
          <td >${sysFile.dirName}</td>
          <td >${sysFile.sysTypeName}</td>
          <td >${sysFile.typeName}</td>
          <td >${sysFile.total}GB</td>
          <td >${sysFile.free}GB</td>
          <td >${sysFile.used}GB</td>
          <td class="${sysFile.usage gt 80 ? 'text-danger':''}">${sysFile.usage}%</td>
      </tr>
       </c:forEach>                                     
	</table>
</div>
</shield:permssion>

